package com.yy.poly_.polyarr_;

/**
 * chapter08  com.yy.poly_.polyarr_
 * 2023-04-23 10:59
 *
 * @author yy yuyue
 * description : 不可描述
 * @date 2023/4/23 10:59
 */
public class Teacher extends Person{
   private double salary;

    public Teacher(String name, int age, double salary) {
        super(name, age);
        this.salary = salary;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    //重写父类的say()方法

    @Override
    public String say() {
        return super.say() + " 老师 " + " salary = " + salary;
    }
    //特有的方法
    public void teach(){
        System.out.println("老师 " + getName() + " 正在讲Java课程...");
    }
}
